const { defineConfig } = require('@vue/cli-service')
const path = require('path')
module.exports = defineConfig({
  transpileDependencies: true,
  devServer: {
    host: 'localhost',
    port: 1212,
    open: true,
    proxy: {
      [process.env.VUE_APP_BASEAPI]: {
        target: 'https://www.fastmock.site/mock/4edce0d607f964b0ebbe0ad1c87ed4de',
        changeOrigin: true,
        pathRewrite: {
          '^/api': '/api'
        }
      }
    }
  },
  lintOnSave: false,
  chainWebpack: (config) => {
    config.resolve.alias
      .set('@', path.join(__dirname, 'src'))
      .set('_components', path.join(__dirname, './src/components'))
      .set('_views', path.join(__dirname, './src/views'))
      .set('_assets', path.join(__dirname, './src/assets'))
      .set('_utils', path.join(__dirname, './src/utils'))
      .set('_api', path.join(__dirname, './src/api'))
  }
})
